This set of macros provides a means of writing portable procedures that
accept variable argument lists. Routines having variable argument lists
(such as _p_r_i_n_t_f(3)) that do not use stdarg are inherently nonportable,
since different machines use different argument passing conventions. The
stdarg facility is similar to _v_a_r_a_r_g_s(5), but is based on the ANSI
Standard for C.
A variable argument list contains one or more parameters. The rightmost
parameter plays a special role, and is designated _P_a_r_m_N in this
discussion.
_v_a__l_i_s_t is a type suitable for storing information needed by the macros
vvvvaaaa____ssssttttaaaarrrrtttt, vvvvaaaa____aaaarrrrgggg, and vvvvaaaa____eeeennnndddd. The called function must declare a
variable (referred to as _a_p) of type _v_a__l_i_s_t, used to access the argument
list.
The vvvvaaaa____ssssttttaaaarrrrtttt ((((aaaapppp,,,, _P_a_r_m_N) macro initializes _a_p for subsequent use by
vvvvaaaa____aaaarrrrgggg and vvvvaaaa____eeeennnndddd. vvvvaaaa____ssssttttaaaarrrrtttt must be called before any use of vvvvaaaa____aaaarrrrgggg.
The ANSI C Standard (ANSI X3.159-1989) restricts the type of _p_a_r_m_N to one
of the types resulting from the _d_e_f_a_u_l_t _a_r_g_u_m_e_n_t _p_r_o_m_o_t_i_o_n_s, currently
iiiinnnntttt, uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt, pointer, or ddddoooouuuubbbblllleeee. If vvvvaaaa____ssssttttaaaarrrrtttt is invoked with a
_p_a_r_m_N which is not one of these types (e.g., if _p_a_r_m_N is sssshhhhoooorrrrtttt or cccchhhhaaaarrrr)
the behavior is undefined.
The vvvvaaaa____aaaarrrrgggg ((((aaaapppp,,,, _t_y_p_e) macro will return the next argument in the list
pointed to by _a_p. The first invocation of vvvvaaaa____aaaarrrrgggg returns the value of
the argument after that specified by _P_a_r_m_N. Successive invocations
return the values of the remaining arguments in succession. _t_y_p_e is the
type to which the expected argument will be converted when passed as an
argument, as indicated by the _d_e_f_a_u_l_t _a_r_g_u_m_e_n_t _p_r_o_m_o_t_i_o_n_s. Thus,
arguments that are cccchhhhaaaarrrr or sssshhhhoooorrrrtttt should be accessed as iiiinnnntttt; uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr
or uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt should be accessed as uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt; and ffffllllooooaaaatttt arguments
should be accessed as ddddoooouuuubbbblllleeee. Arguments which are pointers should be
accessed using their own type. Different types can be mixed, but it is
up to the routine to know what type of argument is expected.
vvvvaaaa____eeeennnndddd ((((aaaapppp)))) is used to finish up.